//
// ITransformable.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CVector;

public class ITransformable extends IAnimatable {
  private long swigCPtr;

  public ITransformable(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.ITransformable_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(ITransformable obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_ITransformable(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public SWIGTYPE_p_NLMISC__CMatrix getMatrix() {
    return new SWIGTYPE_p_NLMISC__CMatrix(nel3dJNI.ITransformable_getMatrix(swigCPtr, this), false);
  }

  public boolean compareMatrixDate(java.math.BigInteger callerDate) {
    return nel3dJNI.ITransformable_compareMatrixDate(swigCPtr, this, callerDate);
  }

  public java.math.BigInteger getMatrixDate() {
    return nel3dJNI.ITransformable_getMatrixDate(swigCPtr, this);
  }

  public void setTransformMode(ITransformable.TTransformMode mode, SWIGTYPE_p_NL3D__CMatrix__TRotOrder ro) {
    nel3dJNI.ITransformable_setTransformMode__SWIG_0(swigCPtr, this, mode.swigValue(), SWIGTYPE_p_NL3D__CMatrix__TRotOrder.getCPtr(ro));
  }

  public void setTransformMode(ITransformable.TTransformMode mode) {
    nel3dJNI.ITransformable_setTransformMode__SWIG_1(swigCPtr, this, mode.swigValue());
  }

  public void setPos(CVector pos) {
    nel3dJNI.ITransformable_setPos__SWIG_0(swigCPtr, this, CVector.getCPtr(pos), pos);
  }

  public void setPos(float x, float y, float z) {
    nel3dJNI.ITransformable_setPos__SWIG_1(swigCPtr, this, x, y, z);
  }

  public void setRotEuler(CVector rot) {
    nel3dJNI.ITransformable_setRotEuler__SWIG_0(swigCPtr, this, CVector.getCPtr(rot), rot);
  }

  public void setRotEuler(float rotX, float rotY, float rotZ) {
    nel3dJNI.ITransformable_setRotEuler__SWIG_1(swigCPtr, this, rotX, rotY, rotZ);
  }

  public void setRotQuat(SWIGTYPE_p_NLMISC__CQuat quat) {
    nel3dJNI.ITransformable_setRotQuat(swigCPtr, this, SWIGTYPE_p_NLMISC__CQuat.getCPtr(quat));
  }

  public void setScale(CVector scale) {
    nel3dJNI.ITransformable_setScale__SWIG_0(swigCPtr, this, CVector.getCPtr(scale), scale);
  }

  public void setScale(float scaleX, float scaleY, float scaleZ) {
    nel3dJNI.ITransformable_setScale__SWIG_1(swigCPtr, this, scaleX, scaleY, scaleZ);
  }

  public void setScale(float scale) {
    nel3dJNI.ITransformable_setScale__SWIG_2(swigCPtr, this, scale);
  }

  public void setPivot(CVector pivot) {
    nel3dJNI.ITransformable_setPivot__SWIG_0(swigCPtr, this, CVector.getCPtr(pivot), pivot);
  }

  public void setPivot(float x, float y, float z) {
    nel3dJNI.ITransformable_setPivot__SWIG_1(swigCPtr, this, x, y, z);
  }

  public void setMatrix(SWIGTYPE_p_NLMISC__CMatrix mat) {
    nel3dJNI.ITransformable_setMatrix(swigCPtr, this, SWIGTYPE_p_NLMISC__CMatrix.getCPtr(mat));
  }

  public ITransformable.TTransformMode getTransformMode() {
    return ITransformable.TTransformMode.swigToEnum(nel3dJNI.ITransformable_getTransformMode(swigCPtr, this));
  }

  public SWIGTYPE_p_NL3D__CMatrix__TRotOrder getRotOrder() {
    return new SWIGTYPE_p_NL3D__CMatrix__TRotOrder(nel3dJNI.ITransformable_getRotOrder(swigCPtr, this), true);
  }

  public void getPos(CVector pos) {
    nel3dJNI.ITransformable_getPos__SWIG_0(swigCPtr, this, CVector.getCPtr(pos), pos);
  }

  public void getRotEuler(CVector rot) {
    nel3dJNI.ITransformable_getRotEuler__SWIG_0(swigCPtr, this, CVector.getCPtr(rot), rot);
  }

  public void getRotQuat(SWIGTYPE_p_NLMISC__CQuat quat) {
    nel3dJNI.ITransformable_getRotQuat__SWIG_0(swigCPtr, this, SWIGTYPE_p_NLMISC__CQuat.getCPtr(quat));
  }

  public void getScale(CVector scale) {
    nel3dJNI.ITransformable_getScale__SWIG_0(swigCPtr, this, CVector.getCPtr(scale), scale);
  }

  public void getPivot(CVector pivot) {
    nel3dJNI.ITransformable_getPivot__SWIG_0(swigCPtr, this, CVector.getCPtr(pivot), pivot);
  }

  public CVector getPos() {
    return new CVector(nel3dJNI.ITransformable_getPos__SWIG_1(swigCPtr, this), true);
  }

  public CVector getRotEuler() {
    return new CVector(nel3dJNI.ITransformable_getRotEuler__SWIG_1(swigCPtr, this), true);
  }

  public SWIGTYPE_p_NLMISC__CQuat getRotQuat() {
    return new SWIGTYPE_p_NLMISC__CQuat(nel3dJNI.ITransformable_getRotQuat__SWIG_1(swigCPtr, this), true);
  }

  public CVector getScale() {
    return new CVector(nel3dJNI.ITransformable_getScale__SWIG_1(swigCPtr, this), true);
  }

  public CVector getPivot() {
    return new CVector(nel3dJNI.ITransformable_getPivot__SWIG_1(swigCPtr, this), true);
  }

  public void lookAt(CVector eye, CVector target, float roll) {
    nel3dJNI.ITransformable_lookAt__SWIG_0(swigCPtr, this, CVector.getCPtr(eye), eye, CVector.getCPtr(target), target, roll);
  }

  public void lookAt(CVector eye, CVector target) {
    nel3dJNI.ITransformable_lookAt__SWIG_1(swigCPtr, this, CVector.getCPtr(eye), eye, CVector.getCPtr(target), target);
  }

  public IAnimatedValue getValue(long valueId) {
    long cPtr = nel3dJNI.ITransformable_getValue(swigCPtr, this, valueId);
    return (cPtr == 0) ? null : new IAnimatedValue(cPtr, false);
  }

  public String getValueName(long valueId) {
    return nel3dJNI.ITransformable_getValueName(swigCPtr, this, valueId);
  }

  public ITrack getDefaultTrack(long valueId) {
    long cPtr = nel3dJNI.ITransformable_getDefaultTrack(swigCPtr, this, valueId);
    return (cPtr == 0) ? null : new ITrack(cPtr, false);
  }

  public void registerToChannelMixer(CChannelMixer chanMixer, String prefix) {
    nel3dJNI.ITransformable_registerToChannelMixer(swigCPtr, this, CChannelMixer.getCPtr(chanMixer), chanMixer, prefix);
  }

  public static String getPosValueName() {
    return nel3dJNI.ITransformable_getPosValueName();
  }

  public static String getRotEulerValueName() {
    return nel3dJNI.ITransformable_getRotEulerValueName();
  }

  public static String getRotQuatValueName() {
    return nel3dJNI.ITransformable_getRotQuatValueName();
  }

  public static String getScaleValueName() {
    return nel3dJNI.ITransformable_getScaleValueName();
  }

  public static String getPivotValueName() {
    return nel3dJNI.ITransformable_getPivotValueName();
  }

  public final static class TTransformMode {
    public final static TTransformMode DirectMatrix = new TTransformMode("DirectMatrix", nel3dJNI.ITransformable_DirectMatrix_get());
    public final static TTransformMode RotEuler = new TTransformMode("RotEuler");
    public final static TTransformMode RotQuat = new TTransformMode("RotQuat");
    public final static TTransformMode TransformModeCount = new TTransformMode("TransformModeCount");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TTransformMode swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TTransformMode.class + " with value " + swigValue);
    }

    private TTransformMode(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TTransformMode(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TTransformMode(String swigName, TTransformMode swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TTransformMode[] swigValues = { DirectMatrix, RotEuler, RotQuat, TransformModeCount };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

  public final static class TAnimValues {
    public final static TAnimValues OwnerBit = new TAnimValues("OwnerBit", nel3dJNI.ITransformable_OwnerBit_get());
    public final static TAnimValues PosValue = new TAnimValues("PosValue");
    public final static TAnimValues RotEulerValue = new TAnimValues("RotEulerValue");
    public final static TAnimValues RotQuatValue = new TAnimValues("RotQuatValue");
    public final static TAnimValues ScaleValue = new TAnimValues("ScaleValue");
    public final static TAnimValues PivotValue = new TAnimValues("PivotValue");
    public final static TAnimValues AnimValueLast = new TAnimValues("AnimValueLast");

    public final int swigValue() {
      return swigValue;
    }

    public String toString() {
      return swigName;
    }

    public static TAnimValues swigToEnum(int swigValue) {
      if (swigValue < swigValues.length && swigValue >= 0 && swigValues[swigValue].swigValue == swigValue)
        return swigValues[swigValue];
      for (int i = 0; i < swigValues.length; i++)
        if (swigValues[i].swigValue == swigValue)
          return swigValues[i];
      throw new IllegalArgumentException("No enum " + TAnimValues.class + " with value " + swigValue);
    }

    private TAnimValues(String swigName) {
      this.swigName = swigName;
      this.swigValue = swigNext++;
    }

    private TAnimValues(String swigName, int swigValue) {
      this.swigName = swigName;
      this.swigValue = swigValue;
      swigNext = swigValue+1;
    }

    private TAnimValues(String swigName, TAnimValues swigEnum) {
      this.swigName = swigName;
      this.swigValue = swigEnum.swigValue;
      swigNext = this.swigValue+1;
    }

    private static TAnimValues[] swigValues = { OwnerBit, PosValue, RotEulerValue, RotQuatValue, ScaleValue, PivotValue, AnimValueLast };
    private static int swigNext = 0;
    private final int swigValue;
    private final String swigName;
  }

}
